package model;

import utilities.GameResource;
import font.BitmapFont;

public class DrugInfo extends ItemInfo {
	public String m_strDes;

	public DrugInfo(){
		m_imgPart = new Part();
	}
	public void initDescription(){
		super.initDescription();
		if(m_iId <= 3)
			m_vtDescription.addElement("Thuốc trị " + m_strName);
		else
			m_vtDescription.addElement(m_strName);
		
		String str = "";
		if(m_iMoney[0] > 0)
			str += GameResource.gold + GameResource.space + m_iMoney[0];
		if(m_iMoney[1] > 0)
			str += GameResource.space + GameResource.dina + GameResource.space + m_iMoney[1];
		
		m_vtDescription.addElement(str);
		
		str = "Kinh nghiệm " + m_sExperience;
		m_vtDescription.addElement(str);
		
		
		String[] tmpString = BitmapFont.m_bmFont.splitFontBStrInLine(m_strDes, 150);
		int i,j;
		for(j= 0 ; j <tmpString.length;j++){
			m_vtDescription.addElement(tmpString[j]);
		}
		
		int max = -999;
		int a = m_vtDescription.size();
		for(i = 0; i < a; i++){
			str = (String)m_vtDescription.elementAt(i);
			int length = BitmapFont.m_facedeFont.stringWidth(str);
			if(length > max)
				max = length;
		}
			
		m_iWidthInfo = max + 20;
		m_iHeightInfo = 55 + j*15;
	}
}
